<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="wrap">

<head>
	<meta charset="UTF-8">
	<title>virtualMachineClass</title>
	<link rel="stylesheet" href="css/pc/cores/style.css" />
	<link rel="stylesheet" href="css/public/fh.css" />
	<link rel="stylesheet" href="css/public/list.css" />
	<link rel="stylesheet" href="css/pc/cores/alert.css" />
	<link rel="stylesheet" href="css/pc/modules/virtualMachineClass.css" />
	<link rel="stylesheet" href="css/pc/modules/endClassList.css" />
	<style>
		input::-webkit-clear-button { visibility: hidden; }
		input[type=date]::-webkit-inner-spin-button { visibility: hidden; }
		.datas{
			height: 34px;
			border: 1px solid #dfdfdf;
			border-radius: 5px;
			padding-left: 12px;
			font-size: 14px;
			padding-right: 7px;
			color: #333;
			line-height: 79px;
		}
		.tableBox{
			margin-bottom: 20px;
		}
		.inputRight{
			margin-right: 40px;
			margin-bottom: 20px;
		}
		.publicSelect{
			width: 164px;
			height: 34px;
			border: 1px solid #dfdfdf;
			border-radius: 5px;
			padding-left: 12px;
			font-size: 14px;
			padding-right: 35px;
			color: #333;
		}
		.searchBtn{
			width: 110px;
			height: 38px;
			line-height: 38px;
			background-color: #c2040e;
			font-size: 16px;
			margin-bottom: 35px;
			border-radius: 5px;
			margin-right: 2%;
			color: #fff;
			text-align: center;
			cursor: pointer;
		}
		.mar-top{
			margin-top: 4px;

		}

		.tableBox tr th{
			background: #ededef;
			color: #333;
			font-size: 18px;
			font-weight: 700;
			height: 50px;
			line-height: 50px;
		}
		.tableBox tr td{
			background: #fffbfb;
			font-size: 14px;
			height: 40px;
			line-height: 40px;
		}
		.initAchievement{
			width: 110px;
			height: 38px;
			line-height: 38px;
			background-color: #c2040e;
			font-size: 16px;
			margin-bottom: 35px;
			border-radius: 5px;
			color: #fff;
			text-align: center;
			cursor: pointer;

		}
		.crumbs a:nth-of-type(2){
			cursor: pointer;
		}
       .sta{
		   color: #c2040e;
	   }
	</style>
</head>

<body>
<!--面包屑-->
<div class="crumbs">
	<div class="index-img"></div>
	<a href="javascript:void(0)" id="myPage">首页</a><label>></label>
	<a href="javascript:void(0)" class="endM">班级管理</a><label>></label>
	<a href="javascript:void(0)">手机考勤</a>
</div>
<!-- 标题 -->
<div class=" ">
	<div class="title_nav">
		<div class="title_box_select fl" id="table_one">手机考勤</div>
<%--		<div class="xxtz" id="fanhui"><a href="javascript:void(0)" class="returnA">返回</a></div>--%>
	</div>
	<div class="main" style="padding-bottom: 20px">
		<div class="funBox">

			<div class="fl inputRight"><label for="curriculumNames">日期:&ensp;</label>
				<input type="date" name="user_date" class="datas"/>
			</div>
			<div class="fl inputRight"><label for="state">状&ensp;&ensp;&ensp;&ensp;态:&ensp;</label>
				<select id="state" class="publicSelect"  />
				<option value="正常">正常</option>
				<option value="缺勤">缺勤</option>
				</select>
			</div>

			<div class="fl publicBtn searchBtn ">搜索</div>

			<div class="fr buttonBatch">
				手机考勤&ensp;
				<span style="margin-right:20px">
				<label><input name="Fruit" type="radio" value=true />开启 </label>
				<label><input name="Fruit" type="radio" value=false />关闭 </label>
			</span>
				<div class="fr publicBtn initAchievement">设置</div>
			</div>

			<div class="clear"></div>


		</div>
		<div>
			<table class="tableBox box_1 table-css" border="0" cellspacing="0" cellpadding="0">


			</table>
		</div>
	</div>
	<div class="clear"></div>

</div>
</div>
</div>
</div>

<script type="text/javascript" src="js/public/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/public/frame.js"></script>
<script type="text/javascript" src="js/public/jquery.page.js"></script>
<script type="text/javascript" src="js/pc/cores/delogin.js"></script>
<script type="text/javascript" src="js/pc/cores/noticeShow.js"></script>
<script type="text/javascript" src="js/pc/cores/Alert.js"></script>
<script type="text/javascript" src="js/pc/modules/phone.js"></script>

<script>
	var result = '${result}';
	result = JSON.parse(result);
	$('.xxtz').click(function () {
		window.history.back(-1);
	})
	switchs()

	var endTime;
	var info = [];
	var startTime;
	var switchOn;
	//获取数据

	//点击设置
	$('.initAchievement').click(function() {
		var json = JSON.stringify({
			"pageName": "pc/phoneSeting",
			"paramData": {
				"courseId": result.paramData.courseId,
				"classId": result.paramData.classId,

			}
		});

		window.location.href = "skipPage?jsonStr=" + json;
	})
	$('input[type=radio][name=Fruit]').change(function() {
		getval()
	})

	function getval(){
		let values = {
			"courseId":result.paramData.courseId,
			"classId" :result.paramData.classId,
			"endTime" :endTime,
			"startTime":startTime,
			"info":info,
			"switchOn":$('input[name="Fruit"]:checked').val(),

		};
		$.ajax({
			type: "post",
			url: "attendance-mobile/config/update",
			contentType:"application/json;charset=utf-8",
			async: true,
			data: JSON.stringify(values),
			success: function(data, status, xhr) {
				if(data.code == 200){


				}
			},
			error: function(data, status, xhr) {
				//loading1.hide();
				var json = JSON.stringify({
					"pageName": "error"
				});


			}
		});
	}
	//获取设置开光
	function switchs() {
		$.ajax({
			type: "get",
			url: "attendance-mobile/config?classId="+result.paramData.classId+"&courseId="+result.paramData.courseId,
			contentType:"application/json;charset=utf-8",
			success: function(data, status, xhr) {
				if(data.code == 200){
					endTime = data.data.endTime;
					info = data.data.info;
					startTime = data.data.startTime;
					switchOn = data.data.switchOn;

					if(data.data.switchOn == false){
						$('input:radio:last').attr('checked', 'checked');
					}else{
						$('input:radio:first').attr('checked', 'checked');
					}
				}
			},
			error: function(data, status, xhr) {
				//loading1.hide();
				var json = JSON.stringify({
					"pageName": "error"
				});


			}
		});
	}

	//

</script>
</body>

</html>